import { ORDER_LIST_DATA } from './actionsTypes.js';
import api from '../../../http/api'
export const getOrderList = (obj) => {
  return {
    type: ORDER_LIST_DATA,
    obj
  }
}

const getOrderListData = (page) => {
  return (dispatch) => {
    api.getOrderList({
      page: page || 0
    }).then((res) => {
      dispatch(getOrderList({
        list: res.data.digestlist,
        page: page
      }))
    })
  }
}

export default getOrderListData